package jonaPad;

import javax.swing.JInternalFrame;
import javax.swing.JTextArea; 
//import javax.swing.JInternalFrame;
import javax.swing.JScrollPane;
//import java.awt.event.*;
//import java.awt.*;


/* Used by InternalFrameDemo.java. */
public class MyInternalFrame extends JInternalFrame {
    static final long serialVersionUID = 10103;
	static int openFrameCount = 0;
    static final int xOffset = 30, yOffset = 30;
    private JScrollPane jsp1;
    private JTextArea jta1;
    
    public MyInternalFrame(String text) {
    	this();
    	jta1.setText(text);
    }
    public MyInternalFrame() {
    	super("Document #" + (++openFrameCount), 
              true, //resizable
              false, //closable
              true, //maximizable
              false);//iconifiable

    	
    	
        setSize(300,300);
       // JScrollPane scrollableTextArea = new JScrollPane(textArea);
        jta1 = new JTextArea();
        jsp1 = new JScrollPane(jta1);
        //jta1.setAutoscrolls(true);
        //jta1.setSize(300,300);
        //jsp1.add(jta1);
        //jsp1.repaint();
        add(jsp1);
        //...Create the GUI and put it in the window...

        //...Then set the window size or call pack...
 
        //Set the window's location.
        setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
    }
}
